Formatting variables

The Item Editor uses a special mechanism for formatting variables, called the var format. In the Standard View that students see, the var format renders symbol variables such as vectors, italic letters, and Greek letters. When students roll their mouse over a variable, they see how to type it in the math palette.

Note: In the Item Editor, variables have a gray background so you can easily identify them.

Variables can appear inside TeX formatting. Before a rendered version of a TeX tag is generated, any embedded variables are replaced by a TeX expression representing the variable symbol, value, and/or units.

Applying var formatting to a variable name in text

  1. Enter the variable name directly into the item.
  2. Highlight the name.
  3. Select var from the entity window.

Including a random variable in an answer

To include variables in answers, enter the variable name as a symbol in the answer box. For example, if you defined random values for the variables m_1 and v, you might enter the answer:

0.5*m_1*v^2

A student working the item must enter the correct numerical answer corresponding to the specific values for m_1 and v that were displayed in the item. If you defined the following:

Variable Min Max Step
m_1 0 5 1
v 1 10 1

One iteration could show a student the values m_1=2 and v=3. The correct answer for that iteration is 9.

Controlling the appearance of randomized variables

Wherever you insert a variable in an item, you can choose whether the variable name and units should appear (m = 10 kg, 10 kg, or just 10) by setting the showSymbol, showUnits, and showValue attributes of the var entity appropriately. Here are some of the more common settings:

showSymbol, showUnits, showValue Example
blank, blank, blank (default) 10 kg
1, blank, blank m=10 kg
1, 0, 0 m
0, 0, 1 10

 

See also:

Random variables overview

Defining random variables

var tag examples